<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text">
    <script>
        const input = document.querySelector('input')
        input.addEventListener('input',debounce(function() {
            console.log(111);
        },1000))
        function debounce(fn,delay) {
            let timer = null
            return function() {
                clearTimeout(timer)
                timer = setTimeout(() => {
                    fn.call(this)
                }, delay);
            }
        }
    </script>
</body>
</html>
